﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DHAA.Areas.Administrator.Models.AdminModels>" %>




<style type="text/css">
    .style1
    {
        width: 80px;
    }
    .style2
    {
        width: 200px;
    }
</style>





<h3> Administrator Details </h3>
<script src="<%=ResolveUrl("~/Scripts/MicrosoftAjax.js")%>"></script>
<script src="<%=ResolveUrl("~/Scripts/MicrosoftMvcValidation.js")%>"></script>
<div id = "UserControlCotainer">
<% Html.EnableClientValidation();
      //  using (Html.BeginForm("ChangePass", "Admin", FormMethod.Post, new {id = "FormChangePass"}))
   using(Ajax.BeginForm("ChangePass", new AjaxOptions {UpdateTargetId = "AjaxContent", LoadingElementId = "loadingIcon"}))
   {
       %><div>
    <%=Html.HiddenFor(m=>m.AdminID) %>
    <%=Html.HiddenFor(m=>m.Username) %>
    <div class="Message Error"><%= ViewData["MessageError"] %></div>
    <div class="Message Success"><%= ViewData["MessageSuccess"] %></div>
        <%=Html.LabelFor(m => m.AdminName)%> <%=Html.TextBoxFor(m => m.AdminName)%><br />
        <br />
        Changing Password:
        <br />
        <br />
        <table style="width:100%;">
            <tr>
                <td class="style1">
                    Current password</td>
                <td class="style2">
                    <%=Html.PasswordFor(m => m.Password,
                                        new
                                            {
                                                id = "CurrentPass",
                                                name = "CurrentPass",
                                                style = "boder:solid 10px red;"
                                            })%></td>
                <td>
                    <%=Html.ValidationMessageFor(m => m.Password)%></td>
            </tr>
            <tr>
                <td colspan="3">
                    <hr style="width: 80%" />
                </td>
            </tr>
            <tr>
                <td class="style1">
                    <%=Html.LabelFor(m => m.NewPassword)%></td>
                <td class="style2" >
                    <%=Html.PasswordFor(m => m.NewPassword, new {id = "NewPassword", name = "NewPassword"})%></td>
                <td >
                <%=Html.ValidationMessageFor(m => m.NewPassword)%>
                </td>
            </tr>
            <tr>
                <td class="style1" >
                    <%=Html.LabelFor(m => m.ConfirmPassword)%></td>
                <td class="style2" >
                <%=Html.PasswordFor(m => m.ConfirmPassword)%>
                    </td>
                <td>
                    <%=Html.ValidationMessageFor(m => m.ConfirmPassword)%></td>
            </tr>
            <tr>
                <td colspan="3">
                    <input type="submit" value="Save Changes"/><div id="loadingIcon" ></div></td>
            </tr>
          </table>
        
    </div>
    <% }
    
    %>
</div>